package edu.uoc.tds.pac4.beans;

import java.io.Serializable;
import java.sql.ResultSet;
import java.sql.SQLException;

public class EstIngressos implements Serializable {
	private static final long serialVersionUID = 1L;
	private String universitat;
	private String centre;
	private String tipusEvent;
	private Double ingres;
	
	public EstIngressos(String universitat, String centre, String tipusEvent,
			Double ingres) {
		super();
		this.universitat = universitat;
		this.centre = centre;
		this.tipusEvent = tipusEvent;
		this.ingres = ingres;
	}

	public EstIngressos() {
		super();
	}

	public String getUniversitat() {
		return universitat;
	}

	public void setUniversitat(String universitat) {
		this.universitat = universitat;
	}

	public String getCentre() {
		return centre;
	}

	public void setCentre(String centre) {
		this.centre = centre;
	}

	public String getTipusEvent() {
		return tipusEvent;
	}

	public void setTipusEvent(String tipusEvent) {
		this.tipusEvent = tipusEvent;
	}

	public Double getIngres() {
		return ingres;
	}

	public void setIngres(Double ingres) {
		this.ingres = ingres;
	}
	
	/**
	 * Construeix a partir d'un RS
	 * @param rs
	 * @throws SQLException 
	 */
	public void buildFromRS(ResultSet rs) throws SQLException {
		// Event
		this.setIngres(rs.getDouble("ingres"));
		this.setCentre(rs.getString("c_nom"));
		this.setTipusEvent(rs.getString("t_nom"));
		this.setUniversitat(rs.getString("u_nom"));
	}
	
}
